﻿using AllInOne.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AllInOne.Pages
{
    /// <summary>
    /// ConfirmCarInfoPage.xaml 的交互逻辑
    /// </summary>
    public partial class InputCarInfoPage : Page
    {

        private MainWindow parent;

        public InputCarInfoPage()
        {
            InitializeComponent();
        }

        public InputCarInfoPage(MainWindow parent)
        {
            InitializeComponent();
            this.parent = parent;
        }


        public void InitPage() {
            //yangzk 左上角的菜单名字
            //this.imgTitle.Source = new BitmapImage(new Uri(this.parent.businessInfo.getImgTitleUrl()));

            this.txtHphm.Text = "号牌号码: " + this.parent.carInfo.hphm;
            this.txtSyr.Text = "所有人：" + this.parent.carInfo.syr;
            this.txtLxdz.Text = "联系地址: " + this.parent.carInfo.zsxxdz;
            this.txtPpxh.Text = "品牌型号: " + this.parent.carInfo.clpp1 + this.parent.carInfo.clxh;
            this.txtFdjh.Text = "发动机号: " + this.parent.carInfo.fdjh; 
            this.txtClsbdh.Text = "车辆识别代号: " + this.parent.carInfo.clsbdh;

            this.parent.PlaySound(Properties.Resources.male_confirm_car_info, Properties.Resources.female_confirm_car_info);

        }

        private void BtnConfirm_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.ShowSignPad();
        }

        private void BtnBackToIndex_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.ResetIndex();
        }

        private void txtPlateInput_MouseDown(object sender, MouseButtonEventArgs e)
        {
            CarNumberInputPage pageView = new CarNumberInputPage();



            //pageView.Sho
            //bool ? result = pageView.ShowsNavigationUI();
            ////弹出选择车牌号页面
            //AuthModel authModel = ShowAuth();
            //if (authModel != null) SignIn(authModel);
        }

        #region 授权、确认窗体
        ///// <summary>
        ///// 弹出输入车牌号窗体并返回值
        ///// </summary>
        ///// <returns></returns>
        //private AuthModel ShowAuth()
        //{
        //    Auth auth = new Auth();
        //    bool? result = auth.ShowDialog();
        //    if (result == true)
        //        return new AuthModel() { AuthType = auth.AuthType, AuthCode = auth.AuthCode };
        //    else
        //        return null;
        //}


        ///// <summary>
        ///// 弹出确认框并返回值
        ///// </summary>
        ///// <param name="showMsg"></param>
        ///// <returns></returns>
        //private bool ShowConfirm(string showMsg)
        //{
        //    Confirm confirm = new Confirm(showMsg, SystemParam.CountDownConfirm);
        //    return confirm.ShowDialog() ?? false;
        //}

        //private void ShowInfo(string showMsg)
        //{
        //    InfoView info = new InfoView(showMsg, SystemParam.CountDownInfo);
        //    info.ShowDialog();
        //}
        #endregion

    }
}
